package org.openjava.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

 

public class RegExpUtils  {
	 
	public static String replaceQuotation(String str){
		Pattern pattern = Pattern.compile("\"");
		Matcher matcher = pattern.matcher(str);
		StringBuffer buffer = new StringBuffer();
		while(matcher.find()){
			matcher.appendReplacement(buffer, "'");
		}
		matcher.appendTail(buffer);
		pattern = Pattern.compile("\\\\'");
		matcher = pattern.matcher(buffer.toString());
		buffer = new StringBuffer();
		while(matcher.find()){
			matcher.appendReplacement(buffer, "\\\\\"");
		}
		matcher.appendTail(buffer);
		return buffer.toString();
	}
	
	
}
